﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameUtils.Input
{
    public sealed class MouseEventArgs : EventArgs
    {
        #region Properties
        public bool ControlPressed
        {
            get { return (mWParam & 0x0008) > 0; }
        }

        public bool ShiftPressed
        {
            get { return (mWParam & 0x0004) > 0; }
        }

        public bool LeftButtonPressed
        {
            get { return (mWParam & 0x0001) > 0; }
        }

        public bool MiddleButtonPressed
        {
            get { return (mWParam & 0x0010) > 0; }
        }

        public bool RightButtonPressed
        {
            get { return (mWParam & 0x0002) > 0; }
        }        

        public bool XButton1Pressed
        {
            get { return (mWParam & 0x0020) > 0; }
        }

        public bool XButton2Pressed
        {
            get { return (mWParam & 0x0040) > 0; }
        }

        public int X
        {
            get { return mLParam & 0xffff; }
        }

        public int Y
        {
            get { return (mLParam >> 16) & 0xffff; }
        }

        public int Wheel
        {
            get { return (mWParam >> 16) & 0xffff; }
        }

        private int mWParam;
        private int mLParam;
        #endregion

        #region Constructors
        public MouseEventArgs(
            int pWParam,
            int pLParam)
        {
            mWParam = pWParam;
            mLParam = pLParam;
        }
        #endregion
    }
}